#include "stdBurst.h"
#include <json.h>

stdBurst::stdBurst(string& filename)
{
	add = 0;
	int start, end;
	float range;
	ifstream infile;
	infile.open(filename.c_str());

	Json::Reader reader;
	Json::Value root;
	if (!reader.parse(infile, root, false))
	{
		cout << "json error";
	}

	int size = root.size();

	for (int i = 0; i < size; i++)
	{
		start = root[i]["startBitmap"].asInt();
		end = root[i]["endBitmap"].asInt();
		range = (float)root[i]["range"].asDouble();
	}
	infile.clear();
	infile.close();

	Resource* r = 0;
	r = r->Instance();
	bitmap.setInformation(r->_arrBurst, start, end, range);
}